package woaini.fenger.core.utils;


import cn.hutool.core.thread.ExecutorBuilder;
import lombok.experimental.UtilityClass;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * 线程工具类
 * @see  woaini.fenger.core.utils.ThreadTool
 * @author yefeng
 * {@code @Date} 2023-05-16 16:50:39
 */
@UtilityClass
public class ThreadTool {

    public static final ExecutorService COMMON_EXECUTOR = ExecutorBuilder.create()
            .setCorePoolSize(5).setMaxPoolSize(10).setWorkQueue(new LinkedBlockingQueue<>(100)).build();

    public void run(Runnable runnable){
        COMMON_EXECUTOR.execute(runnable);
    }
}
